package com.aspose.cells.a.d;

import java.util.HashMap;

public abstract class zge {
   private int a;
   private int b;
   private StringBuilder c = new StringBuilder();
   private String d;
   private HashMap e = new HashMap();
   private HashMap f = new HashMap();
   private HashMap g = new HashMap();
   private HashMap h = new HashMap();
   private HashMap i = new HashMap();
   private zal j = new zal();

   protected zge(String var1) {
      this.d = var1;
   }

   public String a(zfq var1) throws Exception {
      String var2 = this.c(var1);
      return var2;
   }

   public zgj a(byte[] var1) throws Exception {
      var1 = this.b(var1);
      int var2 = zbj.a(var1);
      zgj var3 = (zgj)this.e.get(var2);
      if (var3 == null) {
         var3 = new zgj(this.c(var1), zbn.b(var1), var1);
         this.e.put(var2, var3);
      }

      return var3;
   }

   public void a() throws Exception {
   }

   public String a(String var1) {
      String var2 = (String)this.i.get(var1);
      if (var2 != null) {
         return var2;
      } else {
         var2 = com.aspose.cells.b.a.zv.a("bookmark_{0}", this.a++);
         this.i.put(var1, var2);
         return var2;
      }
   }

   private byte[] b(byte[] var1) throws Exception {
      int var2 = var1.hashCode();
      byte[] var3 = (byte[])((byte[])this.f.get(var2));
      if (var3 == null) {
         var3 = zgk.a(var1);
         this.f.put(var2, var3);
      }

      return var3;
   }

   public String a(zfq var1, String var2) throws Exception {
      zft var3 = this.b(var1);
      this.c.setLength(0);

      for(int var4 = 0; var4 < var2.length(); ++var4) {
         if (var3.a(var2.charAt(var4)) >= 0) {
            this.c.append(var2.charAt(var4));
         }
      }

      return com.aspose.cells.b.a.zr.a(this.c);
   }

   private zft b(zfq var1) throws Exception {
      String var2 = this.c(var1);
      zft var3 = (zft)this.g.get(var2);
      if (var3 == null) {
         var3 = new zft(var1, false);
         this.g.put(var2, var3);
      }

      return var3;
   }

   private String c(byte[] var1) throws Exception {
      int var2 = zbn.a(var1);
      String var3 = com.aspose.cells.b.a.zv.a("image{0}.{1}", this.b(), zbn.a(var2));
      return this.b(var3);
   }

   private String c(zfq var1) throws Exception {
      String var2 = (String)this.h.get(var1.e());
      if (var2 == null) {
         byte[] var3 = new byte[16];
         zcq.a(c(var1.b()), var3, 0);
         zcq.a(var1.g(), var3, 4);
         com.aspose.cells.b.a.zh var4 = new com.aspose.cells.b.a.zh(var3);
         String var5 = "od" + com.aspose.cells.b.a.zv.b(com.aspose.cells.b.a.d.zk.d(var1.e()), new char[]{'.'}).toLowerCase();
         String var6 = var4.a("D");
         var2 = this.b(com.aspose.cells.b.a.zv.a("{0}.{1}", var6, var5));
         this.h.put(var1.e(), var2);
      }

      return var2;
   }

   private String b(String var1) {
      return zgb.a(this.d, var1);
   }

   private static int c(String var0) {
      int var1 = 352654597;
      int var2 = var1;
      int var3 = 0;

      for(int var4 = var0.length(); var4 > 0; var4 -= 4) {
         char var5 = var0.charAt(var3);
         char var6 = 0;
         if (var4 > 1) {
            var6 = var0.charAt(var3 + 1);
         }

         char var7 = 0;
         if (var4 > 2) {
            var7 = var0.charAt(var3 + 2);
         }

         char var8 = 0;
         if (var4 > 3) {
            var8 = var0.charAt(var3 + 3);
         }

         int var9 = var6 << 16;
         var9 += var5;
         int var10 = var8 << 16;
         var10 += var7;
         var1 = (var1 << 5) + var1 + (var1 >> 27) ^ var9;
         if (var4 <= 2) {
            break;
         }

         var2 = (var2 << 5) + var2 + (var2 >> 27) ^ var10;
         var3 += 4;
      }

      return var1 + var2 * 1566083941;
   }

   private int b() {
      return ++this.b;
   }

   public zal d() {
      return this.j;
   }

   public HashMap e() {
      return this.g;
   }

   protected HashMap f() {
      return this.e;
   }
}
